<?php
namespace Mobile\Model;
use Think\Model;
//订单
class UserModel extends Model {
    /**
    * 获取用户信息和地址信息
    * return 一维数组
    */
    public function getUserAndAddress($openid){
        $field = 'a.user_id as uid,a.c_id,a.nickname,a.openid,a.avatarurl,b.address,b.mobile';
        $sql = 
            'SELECT * FROM sp_user as a 
            LEFT JOIN sp_address as b on a.user_id=b.user_id 
            WHERE a.openId="'.$openid.'"';
        $data = $this->query($sql);

        return $data[0];
    }
}
